package com.fypg.module.medical.dal.mysql.registerorder;

import java.util.*;

import com.fypg.framework.common.pojo.PageResult;
import com.fypg.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.fypg.framework.mybatis.core.mapper.BaseMapperX;
import com.fypg.module.medical.dal.dataobject.registerorder.RegisterOrderDO;
import org.apache.ibatis.annotations.Mapper;
import com.fypg.module.medical.controller.admin.registerorder.vo.*;

/**
 * 挂号订单信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface RegisterOrderMapper extends BaseMapperX<RegisterOrderDO> {

    default PageResult<RegisterOrderDO> selectPage(RegisterOrderPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RegisterOrderDO>()
                .eqIfPresent(RegisterOrderDO::getMedicalCardId, reqVO.getMedicalCardId())
                .eqIfPresent(RegisterOrderDO::getHospitalId, reqVO.getHospitalId())
                .eqIfPresent(RegisterOrderDO::getHospitalEncode, reqVO.getHospitalEncode())
                .likeIfPresent(RegisterOrderDO::getHospitalName, reqVO.getHospitalName())
                .eqIfPresent(RegisterOrderDO::getDepartmentEncode, reqVO.getDepartmentEncode())
                .likeIfPresent(RegisterOrderDO::getDepartmentName, reqVO.getDepartmentName())
                .eqIfPresent(RegisterOrderDO::getDoctorEncode, reqVO.getDoctorEncode())
                .likeIfPresent(RegisterOrderDO::getDoctorName, reqVO.getDoctorName())
                .eqIfPresent(RegisterOrderDO::getRegisterType, reqVO.getRegisterType())
                .betweenIfPresent(RegisterOrderDO::getRegisterScheduleDate, reqVO.getRegisterScheduleDate())
                .betweenIfPresent(RegisterOrderDO::getRegisterBeginTime, reqVO.getRegisterBeginTime())
                .betweenIfPresent(RegisterOrderDO::getRegisterEndTime, reqVO.getRegisterEndTime())
                .likeIfPresent(RegisterOrderDO::getPatientName, reqVO.getPatientName())
                .eqIfPresent(RegisterOrderDO::getPatientCardNo, reqVO.getPatientCardNo())
                .eqIfPresent(RegisterOrderDO::getPatientCardType, reqVO.getPatientCardType())
                .eqIfPresent(RegisterOrderDO::getPatientIdNo, reqVO.getPatientIdNo())
                .eqIfPresent(RegisterOrderDO::getPatientIdType, reqVO.getPatientIdType())
                .eqIfPresent(RegisterOrderDO::getPatientMobilePhone, reqVO.getPatientMobilePhone())
                .eqIfPresent(RegisterOrderDO::getPatientGenderType, reqVO.getPatientGenderType())
                .eqIfPresent(RegisterOrderDO::getOpenId, reqVO.getOpenId())
                .eqIfPresent(RegisterOrderDO::getUnionId, reqVO.getUnionId())
                .eqIfPresent(RegisterOrderDO::getPayType, reqVO.getPayType())
                .eqIfPresent(RegisterOrderDO::getPayModeType, reqVO.getPayModeType())
                .eqIfPresent(RegisterOrderDO::getPlatformOrderNo, reqVO.getPlatformOrderNo())
                .eqIfPresent(RegisterOrderDO::getIsPay, reqVO.getIsPay())
                .eqIfPresent(RegisterOrderDO::getTotalFee, reqVO.getTotalFee())
                .eqIfPresent(RegisterOrderDO::getMedicalInsuranceFee, reqVO.getMedicalInsuranceFee())
                .eqIfPresent(RegisterOrderDO::getDiscountFee, reqVO.getDiscountFee())
                .eqIfPresent(RegisterOrderDO::getPayFee, reqVO.getPayFee())
                .eqIfPresent(RegisterOrderDO::getPayTradeNo, reqVO.getPayTradeNo())
                .betweenIfPresent(RegisterOrderDO::getPayTime, reqVO.getPayTime())
                .eqIfPresent(RegisterOrderDO::getHisOrderNo, reqVO.getHisOrderNo())
                .eqIfPresent(RegisterOrderDO::getHisTradeNo, reqVO.getHisTradeNo())
                .eqIfPresent(RegisterOrderDO::getOrderStatus, reqVO.getOrderStatus())
                .eqIfPresent(RegisterOrderDO::getIsCancelOrder, reqVO.getIsCancelOrder())
                .betweenIfPresent(RegisterOrderDO::getCancelOrderTime, reqVO.getCancelOrderTime())
                .eqIfPresent(RegisterOrderDO::getCancelOrderReason, reqVO.getCancelOrderReason())
                .eqIfPresent(RegisterOrderDO::getWaitNo, reqVO.getWaitNo())
                .betweenIfPresent(RegisterOrderDO::getWaitBeginTime, reqVO.getWaitBeginTime())
                .betweenIfPresent(RegisterOrderDO::getWaitEndTime, reqVO.getWaitEndTime())
                .eqIfPresent(RegisterOrderDO::getVisitLocation, reqVO.getVisitLocation())
                .eqIfPresent(RegisterOrderDO::getVisitDescribe, reqVO.getVisitDescribe())
                .eqIfPresent(RegisterOrderDO::getOrderSource, reqVO.getOrderSource())
                .eqIfPresent(RegisterOrderDO::getOrderReason, reqVO.getOrderReason())
                .eqIfPresent(RegisterOrderDO::getIsHandleBusinessNotice, reqVO.getIsHandleBusinessNotice())
                .eqIfPresent(RegisterOrderDO::getHandleBusinessNoticeCount, reqVO.getHandleBusinessNoticeCount())
                .betweenIfPresent(RegisterOrderDO::getHandleBusinessNoticeTime, reqVO.getHandleBusinessNoticeTime())
                .eqIfPresent(RegisterOrderDO::getPayBody, reqVO.getPayBody())
                .eqIfPresent(RegisterOrderDO::getThirdPartyData, reqVO.getThirdPartyData())
                .eqIfPresent(RegisterOrderDO::getExtendData, reqVO.getExtendData())
                .eqIfPresent(RegisterOrderDO::getSortCode, reqVO.getSortCode())
                .eqIfPresent(RegisterOrderDO::getDescription, reqVO.getDescription())
                .eqIfPresent(RegisterOrderDO::getRemark, reqVO.getRemark())
                .eqIfPresent(RegisterOrderDO::getRegisterTimeFlag, reqVO.getRegisterTimeFlag())
                .betweenIfPresent(RegisterOrderDO::getPayEffectiveTime, reqVO.getPayEffectiveTime())
                .betweenIfPresent(RegisterOrderDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RegisterOrderDO::getId));
    }

}